e670d4d63a720c501044e50bd57cc03dfa09b928,sandbox/rest/src/main/java/brooklyn/rest/commands/locations/AddLocationCommand.java,AddLocationCommand,run,#Json#JerseyClient#CommandLine#,25
Before Change
String jsonFileName = (String) params.getArgList().get(0);
LocationSpec spec = json.readValue(new File(jsonFileName), LocationSpec.class);
ClientResponse response = client.post(uriFor("/v1/locations"),
MediaType.APPLICATION_JSON_TYPE, spec, ClientResponse.class);
System.out.println("Ok: " + response.getLocation());
After Change
String jsonFileName = (String) params.getArgList().get(0);
LocationSpec spec = json.readValue(new File(jsonFileName), LocationSpec.class);
ClientResponse response = client.resource(uriFor("/v1/locations"))
.type(MediaType.APPLICATION_JSON_TYPE).post(ClientResponse.class, spec);
out.println("Ok: " + response.getLocation());
}